import 'package:flutter/material.dart';
import 'package:opene/app_theme.dart';

class PutawaySmallTypeDialog extends StatefulWidget {
  bool smallItem;

  PutawaySmallTypeDialog({this.smallItem});

  @override
  _PutawaySmallTypeDialogState createState() => _PutawaySmallTypeDialogState(smallItem: this.smallItem);
}

class _PutawaySmallTypeDialogState extends State<PutawaySmallTypeDialog> {
  bool smallItem;

  _PutawaySmallTypeDialogState({this.smallItem});

  @override
  Widget build(BuildContext context) {
    return Dialog(
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.circular(12.0),
      ),
      child: Padding(
        padding: const EdgeInsets.only(top: 15, left: 15, right: 15),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.center,
          mainAxisSize: MainAxisSize.min,
          children: <Widget>[
            Text(smallItem ? "Small items storage area!" : "Regular storage area!", style: MyAppTheme.title),
            SizedBox(height: 16.0),
            Image.asset(
              smallItem ? 'assets/images/ic_small_cargo.png' : 'assets/images/ic_large_cargo.png',
              width: 100,
              height: 100,
            ),
            Row(
              children: <Widget>[
                Expanded(
                    flex: 1,
                    child: FlatButton(
                      child: Text(
                        'Close',
                        style: MyAppTheme.title,
                      ),
                      onPressed: () {
                        Navigator.of(context).pop();
                      },
                    )),
                Expanded(
                    flex: 1,
                    child: FlatButton(
                      child: Text(
                        'Confirm',
                        style: MyAppTheme.titlenearlyBlue16,
                      ),
                      onPressed: () {
                        Navigator.of(context).pop('ok');
                      },
                    )),
              ],
            ),
          ],
        ),
      ),
    );
  }
}

class PutawaySucceedDialog extends StatefulWidget {
  String lpn;

  PutawaySucceedDialog({this.lpn});

  @override
  _PutawaySucceedDialogState createState() => _PutawaySucceedDialogState(lpn: this.lpn);
}

class _PutawaySucceedDialogState extends State<PutawaySucceedDialog> {
  String lpn;

  _PutawaySucceedDialogState({this.lpn});

  @override
  Widget build(BuildContext context) {
    return Dialog(
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.circular(12.0),
      ),
      child: Padding(
        padding: const EdgeInsets.only(top: 15, left: 15, right: 15),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.center,
          mainAxisSize: MainAxisSize.min,
          children: <Widget>[
            Text("Tips", style: MyAppTheme.title),
            SizedBox(height: 16.0),
            Text("Inbound LPN: ${lpn}\nputaway successfully", style: MyAppTheme.text),
            Row(
              children: <Widget>[
                Expanded(
                    flex: 1,
                    child: FlatButton(
                      child: Text(
                        'OK',
                        style: MyAppTheme.titlenearlyBlue16,
                      ),
                      onPressed: () {
                        Navigator.of(context).pop('ok');
                      },
                    )),
              ],
            ),
          ],
        ),
      ),
    );
  }
}
